package com.yanchi.controller;

import com.yanchi.feignclient.HystrixClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yanchi
 * @date 2022/1/18 11:35
 */
@RestController
public class HystrixOpenfeignController {

    @Autowired
    private HystrixClient hystrixClient;

    @GetMapping("hello")
    public String hello(Integer id){
        String hystrixResult = hystrixClient.demo(id);
        return "springcloud_hystrix_openfeign ok !" + hystrixResult;
    }

}
